<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            padding: 0;
            margin: 0;
        }
        a{
            text-decoration:none;
            color: #333;
            
        }
       
        ul li{
            display: inline-block;
             height: 20px;
             width: 60px;
            

        }
        ul li a{
            display: block;
            text-align: center;
            background-color: #ccc;
        }
        .active{
            background-color: yellow;
        }
        .centent{
            width: 186px;
            height: 200px;
            border: 1px solid #ccc;
        } 
           

    </style>
    <script>
        window.onload=function(){
        var as=document.querySelectorAll("li  a");
        for (let i = 0; i < as.length; i++) {
            as[i].onclick=function(){
                for (var j = 0; j < as.length; j++) {
                   as[j].className="";
                }
                this.className="active";

                // ajax
                var url=this.attributes["data-url"].value;
            }
            
        }
        }
    </script>
</head>
<body>
    <ul>
        <li><a href="#" class="active" data-url="http://a">列表1</a></li>
        <li><a href="#" data-url="http://b">列表2</a></li>
        <li><a href="#"data-url="http://c">列表3</a></li>
    </ul>
    <div class="content">

    </div>
</body>
</html>